package com.dly.blog.controller;

import com.dly.blog.domain.vo.ProductVO;
import com.dly.blog.msg.R;
import com.dly.blog.service.ProductService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.catalina.LifecycleState;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@AllArgsConstructor
@RequestMapping("/product")
@Tag(name = "商品模块")
@Slf4j
public class ProductController extends BaseController{

    private final ProductService productService;

    @GetMapping("/list")
    @Operation(summary = "获取商品集合")
    public ResponseEntity<R<List<ProductVO>>> getList(){
        return operate(()-> this.successDate(productService.getList()));
    }
}
